package com.zhuss.controller.advice;

import com.zhuss.advice.complaint.ComplaintReadServiceExt;
import com.zhuss.bean.bo.advice.Complaint.DetailComplaintBo;
import com.zhuss.bean.bo.advice.Complaint.SearchComplaintBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.ReadService;
import com.zhuss.exception.WpsException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhushanshuo
 * @Date: 2020/3/6 9:40
 */
@RestController
@RequestMapping("/complaint")
public class ComplaintReadController extends BaseController {

    @Autowired
    @Qualifier("complaintReadService")
    private ReadService<Object, Object> complaintReadService;

    @Autowired
    @Qualifier("complaintReadServiceExt")
    private ComplaintReadServiceExt complaintReadServiceExt;

    /**
     * 个人列表
     * @throws WpsException
     */
    @ResponseBody
    @RequestMapping("/personalList")
    public Object list(@RequestBody SearchComplaintBo bo) throws WpsException {
        Object result = complaintReadService.list(bo);
        return result;
    }

    /**
     * 详情
     * @throws WpsException
     */
    @ResponseBody
    @RequestMapping("/detail")
    public Object detail(@RequestBody DetailComplaintBo bo) throws WpsException {
        Object result = complaintReadService.detail(bo);
        return result;
    }

    /**
     * 审核列表
     * @throws WpsException
     */
    @ResponseBody
    @RequestMapping("/examineList")
    public Object examineList(@RequestBody SearchComplaintBo bo) throws WpsException {
        Object result = complaintReadServiceExt.examineList(bo);
        return result;
    }

    /**
     * 办理列表
     * @throws WpsException
     */
    @ResponseBody
    @RequestMapping("/handleList")
    public Object handleList(@RequestBody SearchComplaintBo bo) throws WpsException {
        Object result = complaintReadServiceExt.handleList(bo);
        return result;
    }
}
